package com.lipaluma.csv.annotations.config;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import com.lipaluma.csv.io.CsvSourceFactory;

/**
 * Annotation define the configuration for CSV file
 * @author Mario
 */
@Documented
@Inherited
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface CSV {
	/**
	 * delimiter between columns
	 */
	char delimiter() default CsvSourceFactory.CSV_DEFAULT_DELIMITER;
	/**
	 * optional quote who can surrounds columns values
	 */
	char quote() default CsvSourceFactory.CSV_DEFAULT_QUOTE;

	/**
	 * option that trim all values without exception
	 */
	boolean trimAll() default true;
	
	/**
	 * define if the csv file has a header
	 * @return false by default
	 */
	boolean hasHeader() default false;
	
	/**
	 * tell if the parser has to write the header before the lines
	 * @return false to default
	 */
	boolean writeHeader() default false;
	
	/**
	 * return the number of lines of the header
	 * @return 1 by default
	 */
	int nbLinesHeader() default 1;
	
	/**
	 * tell to the process if the column mapping is done by the headers name
	 * return false by default
	 */
	boolean mapColumnsByHeaders() default false;
	
	/**
	 * return the line number who is defined the column headers name
	 * @return
	 */
	int headerLine() default 1;

}
